﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIManager : MonoBehaviour
{
    public static UIManager Instance;

    //public List<GameObject> panelList;
    
    void Awake()
    {
        Instance = this;
    }

    void Start()
    {
        //foreach (var panel in panelList)
        //{
        //    bool active = panel.activeSelf;
        //    panel.gameObject.SetActive(true);
        //    panel.gameObject.SetActive(active);
        //}

        //初始化所有UI_Panel，先显示后隐藏，触发每个界面的Awake
        for (int i = 0; i <= this.transform.childCount - 1; i++)
        {
            Transform child = this.transform.GetChild(i);
            bool active = child.gameObject.activeSelf;
            child.gameObject.SetActive(true);
            child.gameObject.SetActive(active);
        }
        //TipPanel.Instance.gameObject.active = true;
    }

}
